﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace ProjectBase.Core.Web
{
    /// <summary>
    /// The base Model for Handling entity (IPersistentObject). Contains
    ///  1) Item (for Detail, Editing and Creating)
    ///  2) ListModel (for a list view)
    ///  3) Export Model to data exporting (by default into the MS Excel)
    ///  4) Import Model for data loading (by default from MS Excel)
    ///  5) IFilterModel for list filtering
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <typeparam name="TFilter"></typeparam>
    public interface IEntityModel<out T, out TFilter> : IViewModel, IFilterModel<TFilter>
        where T : class, IPersistentObject
        where TFilter : class, IFilter
    {
        /// <summary>
        ///     Current Entity Item used on Detail, New and Edit
        /// </summary>
        T Item { get; }

        /// <summary>
        ///     Data source for List view on current entity.
        /// </summary>
        IListModel ListModel { get; set; }
    }
}